package com.leaf.u_spring.chapter01;

import org.springframework.context.support.ClassPathXmlApplicationContext;

public class BraveKnightTest2 {

	public static void main(String[] args) {
		//加载Spring上下文
		ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("classpath:/spring/knights.xml");
		//获取knight bean
		Knight knight = context.getBean(Knight.class);
		knight.embarkOnQuest();
		context.close();
	}
}
